package com.ys.peony.car300;

import com.ys.peony.model.domain.BaoDanAddInfo;
import com.ys.peony.model.domain.CarAddInfo;
import com.ys.peony.model.domain.CarDetailModel;
import com.ys.peony.model.domain.CarModel;
import com.ys.peony.model.domain.CarType;
import com.ys.peony.model.domain.CityModel;
import com.ys.peony.model.domain.SaveCarModel;

/**
 * Created by 59153 on 2017/8/1.
 * 描述：用单例来保持车辆信息
 */

public class CarDataManager {
    private String userId;//用户唯一标识
    private String loanId;//业务唯一标识
    private String loanName = "";//权属人姓名
    private static CarDataManager carDataManager = null;
    private CarDetailModel mCarDetailModel = null; //抵押物信息model
    private CarModel mCarModel; //vin码获取的车300车辆model
    private CityModel mCityModel;//城市model
    private CarAddInfo mCarAddInfo = new CarAddInfo();//添加车辆需要上传服务端model
    private SaveCarModel saveCarModel; //添加车辆成功返回model
    private BaoDanAddInfo mBaoDanAddInfo = new BaoDanAddInfo();//添加保单需要上传服务端model
    private CarDataManager(){
    }
    public static CarDataManager getInstance() {
        if(carDataManager == null) {
            synchronized (CarDataManager.class) {
                if(carDataManager == null) {
                    carDataManager = new CarDataManager();
                    return carDataManager;
                }
            }
        }
        return carDataManager;
    }
    public void setCarDetailModel(CarDetailModel carDetailModel) {
        mCarDetailModel = carDetailModel;
    }
    public void setCarVinModel(CarModel carModel) {
        mCarModel = carModel;
    }

    public CarDetailModel getCarDetailModel() {
        return mCarDetailModel;
    }

    public CarModel getCarVinModel() {
        return mCarModel;
    }

    public CityModel getmCityModel() {
        return mCityModel;
    }

    public void setmCityModel(CityModel mCityModel) {
        this.mCityModel = mCityModel;
    }

    public CarAddInfo getmCarAddInfo() {
        return mCarAddInfo;
    }

    public void setmCarAddInfo(CarAddInfo mCarAddInfo) {
        this.mCarAddInfo = mCarAddInfo;
    }

    public void setSaveCarModel(SaveCarModel saveCarModel) {
        this.saveCarModel = saveCarModel;
    }
    public SaveCarModel getSaveCarModel() {
        return saveCarModel;
    }

    public static void clear() {
        carDataManager = null;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getLoanId() {
        return loanId;
    }

    public void setLoanId(String loanId) {
        this.loanId = loanId;
    }

    public BaoDanAddInfo getmBaoDanAddInfo() {
        return mBaoDanAddInfo;
    }

    public void setmBaoDanAddInfo(BaoDanAddInfo mBaoDanAddInfo) {
        this.mBaoDanAddInfo = mBaoDanAddInfo;
    }

    public String getLoanName() {
        return loanName;
    }

    public void setLoanName(String loanName) {
        this.loanName = loanName;
    }
}
